package com.webserver6.util;

import com.alibaba.druid.pool.DruidDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class DBUtil {
    private static DruidDataSource dds ;
    static {
       dds = new DruidDataSource();
       dds.setUrl("jdbc:mysql://localhost:3306/bbsdb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true");
       dds.setUsername("root");
       dds.setPassword("root");
       dds.setInitialSize(5);
       dds.setMaxActive(10);
    }
    public static Connection getConnection() throws SQLException {
        return dds.getConnection();
    }
}
